package com.v.im.businessapi.feign;


import com.v.im.businessapi.api.ImChatGroupServiceAPI;
import com.v.im.businessapi.dto.resultDTO.ImChatGroupResultDTO;
import com.v.im.commonmodule.utils.constants.InterfaceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 *  用戶信息客戶端
 */
@FeignClient(name = InterfaceService.BUSINESS_SERVICE_NAME, fallback = ImChatGroupClientService.HystrixClientFallback.class)
public interface ImChatGroupClientService extends ImChatGroupServiceAPI {

    @Slf4j
    @Component
    class HystrixClientFallback implements ImChatGroupClientService {

        @Override
        public List<ImChatGroupResultDTO> getUserGroups(String userId) {
            log.error("调用用户群组服务失败！！！");
            return null;
        }
    }
}
